import myAxios from "@/request";
import type {
  EquipmentInfoQueryRequest,
  EquipmentInfoAddRequest,
  EquipmentInfoUpdateRequest,
} from "@/models/equipment";

/**
 * 分页获取设备列表
 */
export function listEquipmentInfoByPage(
  equipmentInfoQueryRequest: EquipmentInfoQueryRequest
) {
  return myAxios.request({
    url: "/api/equipmentInfo/list/page",
    method: "post",
    data: equipmentInfoQueryRequest,
  });
}

/**
 * 添加设备
 */
export function addEquipmentInfo(
  equipmentInfoAddRequest: EquipmentInfoAddRequest
) {
  return myAxios.request({
    url: "/api/equipmentInfo/add",
    method: "post",
    data: equipmentInfoAddRequest,
  });
}

/**
 * 更新设备
 */
export function updateEquipmentInfo(
  equipmentInfoUpdateRequest: EquipmentInfoUpdateRequest
) {
  return myAxios.request({
    url: "/api/equipmentInfo/update",
    method: "post",
    data: equipmentInfoUpdateRequest,
  });
}

/**
 * 删除设备
 */
export function deleteEquipmentInfo(id: number) {
  return myAxios.request({
    url: "/api/equipmentInfo/delete",
    method: "post",
    data: { id },
  });
}
